#include<bits/stdc++.h>
using namespace std;
class Robot
{
    private:
        string name;
        char type;
        int blood,harm,defen,level;
    public:
        Robot(string _na,char _ty,int _le):name(_na),type(_ty),level(_le)
        {
            if(type=='N')
            {
                blood=level*5;
                harm=level*5;
                defen=level*5;
            }
            else if(type=='A')
            {
                blood=level*5;
                harm=level*10;
                defen=level*5;
            }
            else if(type=='D')
            {
                blood=level*5;
                harm=level*5;
                defen=level*10;
            }
            else if(type=='H')
            {
                blood=level*50;
                harm=level*5;
                defen=level*5;
            }
        }

        void Print()
        {
            cout<<name<<"--"<<type<<"--"<<level<<"--"<<blood<<"--"<<harm<<"--"<<defen<<endl;
        }

        friend bool TranForm(Robot& c1,char _ty);
};
bool TranForm(Robot& c1,char _ty)
{
    if(c1.type==_ty)
        return false;
    c1.type=_ty;
    if(_ty=='N')
    {
        c1.blood=c1.level*5;
        c1.harm=c1.level*5;
        c1.defen=c1.level*5;
    }
    else if(_ty=='A')
    {
        c1.blood=c1.level*5;
        c1.harm=c1.level*10;
        c1.defen=c1.level*5;
    }
    else if(_ty=='D')
    {
        c1.blood=c1.level*5;
        c1.harm=c1.level*5;
        c1.defen=c1.level*10;
    }
    else if (_ty=='H')
    {
        c1.blood=c1.level*50;
        c1.harm=c1.level*5;
        c1.defen=c1.level*5;
    }
    return true;
}
int main()
{
    int t;
    cin>>t;
    int cnt=0;
    while(t--)
    {
        string _na;
        char type,trType;
        int level;
        cin>>_na>>type>>level;
        cin>>trType;
        Robot tmp(_na,type,level);
        if(TranForm(tmp,trType))
        {
            ++cnt;
        }
        tmp.Print();
    }
    cout<<"The number of robot transform is "<<cnt<<endl;
}